from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

op = webdriver.ChromeOptions()
op.add_experimental_option('excludeSwitches', ['enable-automation'])
op.add_experimental_option('useAutomationExtension', False)
op.add_argument("--start-maximized")  #浏览器最大化
driver = webdriver.Chrome(options=op)
driver.get(r"https://jqueryui.com/slider/#multiple-vertical")
sleep(2)
ele1 = driver.find_element(By.CSS_SELECTOR,"#content > iframe")
driver.switch_to.frame(ele1)
wait = WebDriverWait(driver,4,0.5)
ele2 = wait.until(EC.presence_of_element_located((By.XPATH,"//*[@id='master']/span")))
ele3 = wait.until(EC.presence_of_element_located((By.XPATH,"//*[@id='eq']/span[1]/span")))
chains = ActionChains(driver)
chains.drag_and_drop_by_offset(ele2,xoffset=40,yoffset=0).perform()
chains.drag_and_drop_by_offset(ele3,xoffset=0,yoffset=40).perform()
sleep(3)




driver.quit()